<?php
/**
 * @copyright meila.com
 * @author zhanglei11@
 * @name 
 * @param 
 *         $xxx = 作用
 * @static 
 *         更新用户昵称  更新uid2nick  和  nick2uid
 * 
 * 
 */
$dir = dirname(dirname(__FILE__));
include($dir.'/__queue_global.php');

class ml_mq_upnick extends MqClass{
    const QUEUE_NAME = ML_QUEUENAME_UPNICK;
    private $oRedis;
    
    
    public function __construct($queue)
    {
        $this->oRedis = new ml_model_rdsHash();
        return parent::__construct($queue);
    }
    
    /**
     * 
     *
     * @param array $message_data
     * array(
     *        to => xxx@xxx.com
     *        type => register
     *        data => array(
     *        )
     * )
     */
    public function run_job(){
            $arr = $this->src_data;
            $this->oRedis->updateNick($arr['uid'], $arr['nick']);
            //at队列
            ml_tool_sendMq::add_atnick_nick($arr['nick'], $arr['uid']);
        
//        ml_tool_sendmail::sendMessage(ML_SMTP_SENDER_MAIL , ML_SMTP_SENDER_NAME , $arr['email'] , $arr['nick'] , $arr['title'] , $arr['content']);
        return true;
    }

}



ml_run_queue_check(ml_mq_upnick::QUEUE_NAME);

$xblog_obj = new ml_mq_upnick(new McQueue(ml_mq_upnick::QUEUE_NAME));
$argv[1]   = __FILE__;
$xblog_obj->setArgv($argv[1]);
$xblog_obj->execute();
?>